<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<style type="text/css">
    td {
        width: 500px;
    }
    table {
        margin: 50px auto;
    }
    a:hover{
        color: skyblue;
    }
    #textarea{
        height: 200px;
        width: 400px;
    }
    .error{
        color: red;
        margin-left: 10px;
    }
</style>
<body>
<%@include file="index.jsp"%>
<h1 style="text-align: center">添加客户</h1>
<p style="text-align: center;color: red">${error}</p>
<table border="1" cellspacing="0" cellpadding="20">

    <form action="${pageContext.request.contextPath}/addUser" method="post" >

        <tr>
            <th>用户名:</th>
            <td><input type="text" name="username" id="username" value="${user.username}" size="30" /><span class="error">${map.username}</span></td>
        </tr>

        <tr>
            <th>性别:</th>
            <td>
            <input type="radio" name="gender"  value="nan"${user.gender == 'nan'?'checked':''}/>男
            <input type="radio" name="gender"  value="nv"${user.gender == 'nv'?'checked':''}/>女
            <span class="error">${map.gender}</span>
            </td>
        </tr>


        <tr>
            <th>生日:</th>
            <td><input type="date" name="birthday" value="${user.birthday}" size="30" /><span class="error">${map.birthday}</span></td>
        </tr>

        <tr>
            <th>手机号码:</th>
            <td><input type="text" name="phonenum" value="${user.phonenum}" size="30" /><span class="error">${map.phonenum}</span></td>
        </tr>

        <tr>
            <th>邮箱:</th>
            <td><input type="text" name="email" value="${user.email}" size="30" /><span class="error">${map.email}</span></td>
        </tr>


        <tr>
            <th>爱好:</th>
            <td>
                <input type="checkbox" name="hobby" size="30" value="basketball"
                ${fn:contains(user.hobby,'basketball')?'checked':''}
                />篮球
                <input type="checkbox" name="hobby" size="30" value="football"
                ${fn:contains(user.hobby,'football')?'checked':''}
                />足球
                <input type="checkbox" name="hobby" size="30" value="dance"
                ${fn:contains(user.hobby,'dance')?'checked':''}
                />跳舞
                <input type="checkbox" name="hobby" size="30" value="music"
                ${fn:contains(user.hobby,'music')?'checked':''}
                />音乐
                <span class="error">${map.hobby}</span>
            </td>

        </tr>
        <tr>
            <th>客户类型:</th>
            <td><select name="type" id="type">
                <option value="">请选择</option>
                <option value="黑铁客户"${user.type == 'heitie'?'selected':''}>黑铁客户</option>
                <option value="青铜客户"${user.type == 'qingtong'?'selected':''}>青铜客户</option>
                <option value="黄金客户" ${user.type == 'huangjin'?'selected':''}>黄金客户</option>
                <option value="钻石客户" ${user.type == 'zuanshi'?'selected':''}>钻石客户</option>
            </select>
                <span class="error">${map.type}</span>
            </td>
        </tr>
        <tr>
            <th>自我介绍:</th>
            <td>
                <textarea name="introduce" value="introduce" id="textarea">${user.introduce}</textarea>
                <span class="error">${map.introduce}</span>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <input type="submit" name="adduser" id="adduser" value="添加" onclick="add()" />
            </td>
        </tr>
    </form>
</table>
</body>
</html>
<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.min.js"></script>
<script>


</script>


